package com.gaohe.post.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.post.mapper.FmPostOrderMapper;
import com.gaohe.post.domain.FmPostOrder;
import com.gaohe.post.service.IFmPostOrderService;

/**
 * 帖子置顶订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmPostOrderServiceImpl implements IFmPostOrderService 
{
    @Autowired
    private FmPostOrderMapper fmPostOrderMapper;

    /**
     * 查询帖子置顶订单
     * 
     * @param postOrderId 帖子置顶订单主键
     * @return 帖子置顶订单
     */
    @Override
    public FmPostOrder selectFmPostOrderByPostOrderId(Long postOrderId)
    {
        return fmPostOrderMapper.selectFmPostOrderByPostOrderId(postOrderId);
    }

    /**
     * 查询帖子置顶订单列表
     * 
     * @param fmPostOrder 帖子置顶订单
     * @return 帖子置顶订单
     */
    @Override
    public List<FmPostOrder> selectFmPostOrderList(FmPostOrder fmPostOrder)
    {
        return fmPostOrderMapper.selectFmPostOrderList(fmPostOrder);
    }

    /**
     * 新增帖子置顶订单
     * 
     * @param fmPostOrder 帖子置顶订单
     * @return 结果
     */
    @Override
    public int insertFmPostOrder(FmPostOrder fmPostOrder)
    {
        fmPostOrder.setCreateTime(DateUtils.getNowDate());
        return fmPostOrderMapper.insertFmPostOrder(fmPostOrder);
    }

    /**
     * 修改帖子置顶订单
     * 
     * @param fmPostOrder 帖子置顶订单
     * @return 结果
     */
    @Override
    public int updateFmPostOrder(FmPostOrder fmPostOrder)
    {
        fmPostOrder.setUpdateTime(DateUtils.getNowDate());
        return fmPostOrderMapper.updateFmPostOrder(fmPostOrder);
    }

    /**
     * 批量删除帖子置顶订单
     * 
     * @param postOrderIds 需要删除的帖子置顶订单主键
     * @return 结果
     */
    @Override
    public int deleteFmPostOrderByPostOrderIds(Long[] postOrderIds)
    {
        return fmPostOrderMapper.deleteFmPostOrderByPostOrderIds(postOrderIds);
    }

    /**
     * 删除帖子置顶订单信息
     * 
     * @param postOrderId 帖子置顶订单主键
     * @return 结果
     */
    @Override
    public int deleteFmPostOrderByPostOrderId(Long postOrderId)
    {
        return fmPostOrderMapper.deleteFmPostOrderByPostOrderId(postOrderId);
    }
}
